<template>
    <div class="child">
        <h3>孙子组件:孙子</h3>
        <p>姓名：{{ userName }}</p>
        <p>年龄：{{ age }}</p>
        <button @click="add(1)">一天又一天</button>
    </div>
</template>

<script setup lang="ts" name="Child2">
//属性结构
defineProps(['userName','age','add'])


</script>

<style scoped>
.child {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    background-color: #f0f0f0;
}
</style>
